package com.rickpan.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 异步请求配置
 * 用于支持AI聊天的长时间SSE流式传输
 */
@Configuration
public class AsyncConfig implements WebMvcConfigurer {

    @Override
    public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
        // 设置异步请求超时时间为10分钟
        configurer.setDefaultTimeout(600000L);
        
        // 设置异步请求的任务执行器
        // configurer.setTaskExecutor(taskExecutor);
    }
}
